import axios from '../utils/axios'



/**
 * 登出
 * @param params
 * @returns {Promise<AxiosResponse<T>>}
 */
export function logout(params) {
    return axios.post('/tansci/user/logout', params);
}


// ==================登录=============================
/**
 * 登录
 * @param params
 * @returns {Promise<AxiosResponse<T>>}
 */
 export function login(params) {
    // return axios.post('/tansci/user/login', params);
    return axios.post('http://123.57.18.66:8080/login', params);
}

// ==================注册=============================
/**
 *
 * @param params
 * @returns {Promise<AxiosResponse<T>>}
 */
 export function register(params) {
    // return axios.post('/tansci/user/login', params);
    return axios.post('http://123.57.18.66:8080/register', params);
}


/**
 * 修改密码
 * @param {*} params
 * @returns
 */
 export function modifyPass(params) {
    return axios.put('http://123.57.18.66:8080/system/user/profile/updatePwd', params);
}



/**
 * 新建任务组
 * @param {*} params
 * @returns
 */
 export function saveFaceJobGroup(params) {
    return axios.post('http://123.57.18.66:8080/system/dfl/createJobGroup', params);
}

/**
 * 浏览任务组
 * @param {*} params
 * @returns
 */
 export function FaceJobGroupPage(params) {
    return axios.get('http://123.57.18.66:8080/system/dfl/listJobGroup', { params: params });
}


/**
 * 展示任务
 * @param {*} params
 * @returns
 */
 export function FaceJobGroupPagePlus(params) {
    return axios.get('http://123.57.18.66:8080/system/dfl/listJobGroupByPlus', {params:params});
}

/**
 * 修改任务组
 * @param {*} params
 * @returns
 */
 export function updateFaceJobGroup(params) {
    return axios.post('http://123.57.18.66:8080/system/dfl/alterJobGroup', params);
}

/**
 * 删除任务组
 * @param {*} jobId
 * @returns
 */
 export function delFaceJobGroup(jobGroupId) {
    return axios.post(`http://123.57.18.66:8080/system/dfl/deleteJobGroup/${jobGroupId}`);
}


/**
 * 文件上传
 * @param {*} params
 * @returns
 */
 export function apiUploadFile(params) {
    return axios.post('http://123.57.18.66:8080/system/dfl/uploadFileForGroup',params,{
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}

/**
 * 文件下载
 * @param {*} params
 * @returns
 */
 export function apiDownloadFile(params) {
    return axios.get('http://123.57.18.66:8080/system/dfl/downloadFileForGroup',{params:params, responseType: 'blob'});
}

/**
 * 新建任务
 * @param {*} params
 * @returns
 */
 export function saveFaceJob(params) {
    return axios.post('http://123.57.18.66:8080/system/dfl/createSysFaceJob', params);
}

/**
 * 展示任务
 * @param {*} params
 * @returns
 */
 export function FaceJobPage(params) {
    return axios.get('http://123.57.18.66:8080/system/dfl/listSysFaceJobByJobGroup', {params:params});
}

/**
 * 展示任务
 * @param {*} params
 * @returns
 */
 export function FaceJobPagePlus(params) {
    return axios.get('http://123.57.18.66:8080/system/dfl/listSysFaceJobByPlus', {params:params});
}

/**
 * 删除任务
 * @param {*} jobId
 * @returns
 */
 export function delFaceJob(jobId) {
    return axios.post(`http://123.57.18.66:8080/system/dfl/deleteSysFaceJob/${jobId}`);
}


/**
 * 修改任务
 * @param {*} params
 * @returns
 */
 export function updateFaceJob(params) {
    return axios.post('http://123.57.18.66:8080/system/dfl/alterSysFaceJob', params);
}

/**
 * 运行任务
 * @param {*} params
 * @returns
 */
 export function startJob(params) {
    return axios.post('http://123.57.18.66:8080/system/dfl/startJobFarAway', params);
}








